package com.xlkj.ms.tools.core.request;

import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.Min;

/**
 * 
 * @author zhuqifeng
 * @date 2021/11/10 13:54
 * @package com.xlkj.ms.tools.core.request
 */
public abstract class AbstractTenantPageRequest extends AbstractTenantRequestWithValidate{

    private static final long serialVersionUID = 4030952895850833079L;

    /** 当前页，页数只能从1开始 */
    @ApiModelProperty(value = "当前页，页数只能从1开始", allowableValues = "1")
    @Min(1)
    protected Integer page = 1;

    /** 每页总数，默认10个(最少不能小于2个) */
    @ApiModelProperty(value = "每页总数，默认10个(最少不能小于1个)", allowableValues = "10")
    @Min(1)
    protected Integer pageSize = 10;

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        if(null== page){
            page = 1;
        }
        this.page = page;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        if(null==pageSize){
            pageSize = 10;
        }
        this.pageSize = pageSize;
    }
}